<style>
    .setimg{
        margin:-2px 5px 0 0
    }
</style>
<div class="row-fluid">
    <div class="well">
        <div class="btn-toolbar">
            <label style="display: inline">待结算的金额：</label><input type="text" id="wait" style="width: 60px;color: red" readonly /> 元
            <label style="display: inline">&nbsp;&nbsp;可提现的金额：</label><input type="text" id="normal" style="width: 60px;color: red" readonly /> 元
            <label style="display: inline">&nbsp;&nbsp;提现中的金额：</label><input type="text" id="ing" style="width: 60px;color: red" readonly /> 元
            <label style="display: inline">&nbsp;&nbsp;已提现的金额：</label><input type="text" id="ytx" style="width: 60px;color: red" readonly /> 元
            <form style="float: right;">
                <label style="display: inline">订单编号：</label>
                <input type="text" value="<?=I('get.order_id')?>" name="order_id" style="width: 160px" />
                <button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
            </form>
        </div>
        <hr>
        <table class="table">
            <thead>
            <tr>
                <th style="text-align:center;width:170px">订单编号</th>
                <th style="text-align:center;width:170px">收入明细</th>
                <th style="text-align:center;width:170px">买家姓名</th>
                <th style="text-align:center;width:170px">商品信息</th>
                <th style="text-align:center;width:180px">收入金额</th>
                <th style="text-align:center;width:140px">收入时间</th>
            </tr>
            </thead>
            <tbody>
            <?php if($getData){foreach($getData AS $key=>$val){
            $getCustMsg = M('CustEntity')->field(array('nickname','cust_mobile'))->where(array('cust_id'=>$val['cust_id']))->find();
            $getOrderGoods = M('OrderCollect')->where(array('order_id'=>$val['order_id'],'biz_cust_id'=>$val['profit_cust_id']))->select();
            ?>
            <tr>
                <td style="text-align:center;vertical-align:middle;">{{$val['order_id']}}</td>
                <td style="text-align:center;vertical-align:middle;">{{$val['profit_remark']}}</td>
                <td style="text-align:center;vertical-align:middle;">{{$getCustMsg['nickname']}} / {{$getCustMsg['cust_mobile']}}</td>
                <td style="text-align:center;vertical-align:middle;">
                    <table>
                        <?php $salelevel=0;
                        foreach($getOrderGoods as $value){
                        $salelevel=$value['biz_cust_salelevel'];
                        ?>
                        <tr>
                            <td style="text-align:center;vertical-align:middle;">{{$value['goods_title']}}</td>
                            <td style="text-align:center;vertical-align:middle;"> x {{$value['pay_nums']}}</td>
                            <td style="text-align:center;vertical-align:middle;"><?=number_format(($value['pay_price']+$value['goods_taxes_price'])*$value['pay_nums'],2,'.','')?></td>
                        </tr>
                        <?php }?>
                        <tr>
                            <td style="text-align:center;vertical-align:middle;">卖家等级</td>
                            <td style="text-align:center;vertical-align:middle;"></td>
                            <td style="text-align:center;vertical-align:middle;">
                                <if condition="$salelevel eq 1">
                                    <span class="label label-info" style="background-color:#D6D658">嗨呗专员</span>
                                    <elseif condition="$salelevel eq 2"/>
                                    <span class="label label-warning" style="background-color:#93D6CD">嗨呗经理</span>
                                    <elseif condition="$salelevel eq 3"/>
                                    <span class="label label-info" style="background-color:#B387CA">嗨呗总监</span>
                                </if>
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="text-align:center;vertical-align:middle;">{{$val['profit_money']}}</td>
                <td style="text-align:center;vertical-align:middle;">{{$val['add_at']|date='Y-m-d H:i:s',###}}</td>
            </tr>
            <?php }}else{?>
            <tr><td style="text-align:center" colspan='6'>暂无数据</td></tr>
            <?php }?>
            </tbody>
        </table>
        <span style="float:right;margin-top:-44px"><?=$page?></span>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $.get('/index/smoney',{'type':'1','cust_id':"<?=I('get.cust_id')?>"},function(data){
            $('#wait').val(data.data);
        },'json');
        $.get('/index/smoney',{'type':'2','cust_id':"<?=I('get.cust_id')?>"},function(data){
            $('#normal').val(data.data);
        },'json');
        $.get('/index/smoney',{'type':'3','cust_id':"<?=I('get.cust_id')?>"},function(data){
            $('#ing').val(data.data);
        },'json');
        $.get('/index/smoney',{'type':'4','cust_id':"<?=I('get.cust_id')?>"},function(data){
            $('#ytx').val(data.data);
        },'json');
    });
</script>